version: "3"

services:
  nginx:
    image: nginx:stable
    container_name: nginx
    restart: always
    environment:
      NGINX_CONF_HASH: "{{ lookup('template', 'nginx.conf.j2') | striptags | trim | hash('md5') }}"
    volumes:
      - "{{ combined_vars.nginx.deploy_path }}/conf.d:/etc/nginx/conf.d"
      - "{{ combined_vars.nginx.deploy_path }}/stream.d:/etc/nginx/stream.d"
      - "{{ combined_vars.nginx.deploy_path }}/nginx.conf:/etc/nginx/nginx.conf"
      - "/usr/share/zoneinfo/{{ global_timezone }}:/etc/localtime"
    network_mode: host